import {pressionSubRoutesFilter} from '@/utils/pression.js'
import userQianKun from '@/appRegister.js'


const getters = {
    subRoutes:state => {
        if(state.app.userInfo) {
            let subRoutes = pressionSubRoutesFilter(state.app.userInfo.user_authorities.permissionCodeList)
            userQianKun(subRoutes)
            return subRoutes
        }
    },
    isLoginPage:state => state.app.isLoginPage,
    token:state => state.app.tokenInfo ? `${state.app.tokenInfo.token_type} ${state.app.tokenInfo.access_token}` : null,
    roles:state => state.app.userInfo ? state.app.userInfo.user_authorities.permissionCodeList : []
}

export default getters